<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <title>ThinkPHP框架</title>
    <meta name="desc" content="[desc]">
    <meta name="keywords" content="开源WEB开发框架">
    <link rel="icon" href="/favicon.ico">
    <link rel="stylesheet" href="/blog-doing/Public/Admin/css/vendor/bootstrap/dist/bootstrap.css">
    <link rel="stylesheet" href="/blog-doing/Public/Admin/css/vendor/Animate.css">
    <link rel="stylesheet" href="/blog-doing/Public/Admin/css/basic.css">
    <link rel="stylesheet" href="/blog-doing/Public/Admin/css/vendor/font_awesome/css/font-awesome.css">
    <link rel="stylesheet" href="/blog-doing/Public/Common/js/layui/css/layui.css">
    <link rel="stylesheet" href="/blog-doing/Public/Admin/js/wangEditor/dist/css/wangEditor.css">
    <link rel="stylesheet" href="/blog-doing/Public/Admin/js/uploadify/uploadify.css">
    <!--[if lt IE 9]>
    <script src="/blog-doing/Public/Admin/js/vendor/html5shiv.min.js"></script>
    <script src="/blog-doing/Public/Admin/js/vendor/respond.min.js"></script>
    <![endif]-->
    <script>
        window.common_conf = {
        };
    </script>
</head>

<body>
    <header id="page_header">
        <div class="logow animated fadeInLeft"><a href="#"><img src="/blog-doing/Public/Admin/logo.png" width="56"></a></div>
        <div class="right_side">
            <!--<span class="fullScreen_btn"><i class="fa fa-arrows-alt"></i></span>-->
            <a href="<?php echo U('Admin/Login/logout');?>"><span class="logout_btn"><i class="fa fa-sign-out"></i></span></a>
            <span class="toggleMenu_btn"><i class="fa fa-bars"></i></span>
        </div>
    </header>

<aside id="left_panel">
    <div class="login_info">
        <span>
            <div>
                <a href="#" data-toggle="dropdown">
                    <i class="fa fa-user"></i><span class="name"><?php echo ($username); ?></span><span class="caret"></span>
                </a>
                <ul class="dropdown-menu">
                    <li><a tabindex="-1" href="<?php echo U('Admin/UserInfo/index');?>">个人资料</a></li>
                    <li><a class="logout" tabindex="-1" href="<?php echo U('Admin/Login/logout');?>">退出</a></li>
                </ul>
            </div>
        </span>
    </div>
    <nav>
        <ul>
            <li>
                <a href="<?php echo U('Admin/Index/index');?>"><i class="fa fa-lg fa-fw fa-home"></i><span>工作台</span></a>
            </li>
            <?php if(is_array($nav)): $i = 0; $__LIST__ = $nav;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$nav): $mod = ($i % 2 );++$i;?><li>
                <?php if(empty($nav["childNav"])): ?><a href="/blog-doing/index.php?s=/<?php echo ($nav["m"]); ?>/<?php echo ($nav["c"]); ?>/<?php echo ($nav["f"]); ?>"><i class="fa fa-lg fa-fw fa-table"></i><span><?php echo ($nav["title"]); ?></span><b><i class="fa fa-plus-square-o"></i></b></a>
              <?php else: ?>
                <a href="#"><i class="fa fa-lg fa-fw fa-table"></i><span><?php echo ($nav["title"]); ?></span><b><i class="fa fa-plus-square-o"></i></b></a>
             <ul>
               <?php if(is_array($nav['childNav'])): $i = 0; $__LIST__ = $nav['childNav'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$childNav): $mod = ($i % 2 );++$i;?><a href="/blog-doing/index.php?s=/<?php echo ($childNav["m"]); ?>/<?php echo ($childNav["c"]); ?>/<?php echo ($childNav["f"]); ?>"><i class="fa fa-lg fa-fw fa-table"></i><span><?php echo ($childNav["title"]); ?></span><b><i class="fa fa-plus-square-o"></i></b></a><?php endforeach; endif; else: echo "" ;endif; ?>
           </ul><?php endif; ?>
              </li><?php endforeach; endif; else: echo "" ;endif; ?>
            <!-- <li>
                <a href="#"><i class="fa fa-lg fa-fw fa-table"></i><span>菜单管理</span><b><i class="fa fa-plus-square-o"></i></b></a>
                <ul>
                    <li><a href="<?php echo U('Admin/Menu/index');?>"><i class="fa fa-fw fa-file"></i><span>菜单列表</span></a></li>
                    <li><a href="<?php echo U('Admin/Menu/add');?>"><i class="fa fa-fw fa-file"></i><span>新增菜单</span></a></li>
                </ul>
            </li> -->

        </ul>
    </nav>
    <span class="minifyBtn"><i class="fa fa-arrow-circle-left"></i></span>
</aside>

<div id="main">

  <div class="content_wrapper">
      <div class="container-fluid">
          <div class="row">
              <div class="col-sm-12">
                  <aside>
                      <header><i class="fa fa-fw fa-file"></i>新增文章</header>
                      <section>
                          <div class="container-fluid">
                              <div class="row">
                                  <div class="col-sm-12">
                                      <form class="form-horizontal" role="form" id="add-form">
                                          <div class="form-group">
                                              <label class="col-sm-2 control-label">文章标题</label>
                                              <div class="col-sm-3">
                                                  <input type="text" class="form-control" value="<?php echo ($vo["title"]); ?>"placeholder="文章标题" name="title">
                                                  <input type="hidden" name="news_id" value="<?php echo ($vo["news_id"]); ?>">
                                              </div>
                                              <p class="col-sm-7 help-block">必填</p>
                                          </div>
                                          <hr/>
                                          <div class="form-group">
                                              <label class="col-sm-2 control-label">文章分类</label>
                                              <div class="col-sm-3">
                                                  <select class="form-control" name="cid">
                                                      <option value="">请选择</option>
                                                      <?php if(is_array($cid)): $i = 0; $__LIST__ = $cid;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$cid): $mod = ($i % 2 );++$i;?><option value="<?php echo ($cid["menu_id"]); ?>"<?php if($cid["menu_id"] == $vo['cid']): ?>selected<?php endif; ?>><?php echo ($cid["title"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                                                  </select>
                                              </div>
                                          </div>
                                          <hr/>
                                          <div class="form-group">
                                              <label class="col-sm-2 control-label">文章失效时间</label>
                                              <div class="col-sm-3">
                                                  <select class="form-control" name="fail_time">
                                                      <option value="0"<?php if($vo["fail_time"] == 0): ?>selected<?php endif; ?>>请选择</option>
                                                      <option value="1"<?php if($vo["fail_time"] == 1): ?>selected<?php endif; ?>>1天</option>
                                                      <option value="2"<?php if($vo["fail_time"] == 2): ?>selected<?php endif; ?>>2天</option>
                                                      <option value="3"<?php if($vo["fail_time"] == 3): ?>selected<?php endif; ?>>3天</option>
                                                      <option value="4"<?php if($vo["fail_time"] == 4): ?>selected<?php endif; ?>>4天</option>
                                                      <option value="5"<?php if($vo["fail_time"] == 5): ?>selected<?php endif; ?>>5天</option>
                                                      <option value="6"<?php if($vo["fail_time"] == 6): ?>selected<?php endif; ?>>6天</option>
                                                      <option value="7"<?php if($vo["fail_time"] == 7): ?>selected<?php endif; ?>>7天</option>
                                                  </select>
                                              </div>
                                              <p class="col-sm-7 help-block">不选择表示没有失效时间</p>
                                          </div>
                                          <hr/>
                                          <div class="form-group">
                                            <label for="inputname" class="col-sm-2 control-label">缩图:</label>
                                             <div class="col-sm-10">
                                               <input id="img_upload"  type="file" multiple >
                                                 <img id="img_upload_success" src="<?php echo ($vo["img_url"]); ?>" alt="" style="max-height:150px;max-width:200px">
                                             </div>
                                           </div>
                                          <hr/>
                                          <div class="form-group">
                                              <label class="col-sm-2 control-label">简介</label>
                                              <div class="col-sm-10">
                                                  <textarea class="form-control" name="desc"><?php echo ($vo["desc"]); ?></textarea>
                                              </div>
                                          </div>
                                          <hr/>
                                          <div class="form-group">
                                              <label class="col-sm-2 control-label">标签</label>
                                              <div class="col-sm-10" id="tab-box">
                                                  <input type="text" class="form-control" name="tab" id="news-tab">
                                                  <?php if(is_array($vo['tab'])): $i = 0; $__LIST__ = $vo['tab'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$tab): $mod = ($i % 2 );++$i;?><a class='layui-btn layui-btn-normal news-tab' style=display:inline-block;margin-top:10px;text-decoration:none attr-keyword ="<?php echo ($tab); ?>"><?php echo ($tab); ?></a><?php endforeach; endif; else: echo "" ;endif; ?>
                                              </div>

                                          </div>
                                          <hr/>
                                          <div class="form-group">
                                            <div class="col-sm-12">
                                              <textarea id="content" style="height:400px;max-height:500px">

                                              </textarea>
                                            </div>
                                          </div>
                                          <hr/>
                                          <div class="form-group">
                                              <div class="col-sm-12">
                                                  <button type="button" class="btn btn-primary" id="btn-news-submit">提交</button>
                                              </div>
                                          </div>
                                      </form>
                                  </div>
                              </div>
                          </div>
                      </section>
                  </aside>
              </div>
          </div>
      </div>

  </div>

</div>
<footer id="page_footer">
    <div class="inside"><i class="fa fa-copyright"></i><a href="https://github.com/liyu365">liyu</a></div>
</footer>
<script src="/blog-doing/Public/Admin/js/vendor/jquery.min.js"></script>
<script src="/blog-doing/Public/Admin/js/vendor/bootstrap/dist/bootstrap.js"></script>
<script src="/blog-doing/Public/Admin/js/basic.js"></script>
<script src="/blog-doing/Public/Common/js/layer/layer.js"></script>
<script src="/blog-doing/Public/Common/js/layui/layui.js"></script>
<script src="/blog-doing/Public/Common/js/dialog.js"></script>
<script src="/blog-doing/Public/Admin/js/common.js"></script>

<script src="/blog-doing/Public/Admin/js/wangEditor/dist/js/wangEditor.js" charset="utf-8"></script>
<script src="/blog-doing/Public/Admin/js/uploadify/jquery.uploadify.min.js" charset="utf-8"></script>
<script src="/blog-doing/Public/Admin/js/upload.js" charset="utf-8"></script>
<script type="text/javascript">
var URL = {
  'swf':"/blog-doing/Public/Admin/js/uploadify/uploadify.swf",
  'cancelImg_url':"/blog-doing/Public/Admin/js/uploadify/uploadify-cancel.png",
  'add_url':"<?php echo U('Admin/News/add');?>",
  'jump_url':"<?php echo U('Admin/News/index');?>",
  'imgUpload_url':"<?php echo U('Admin/Uploads/image');?>",
}
  wangEditor.config.printLog = false;//关掉日志提示
  var editor = new wangEditor('content');
  editor.create();
  editor.$txt.html('<?php echo ($vo["content"]); ?>');
</script>
</body>
</html>